//数据序列化类统一管理
import 'package:framelib/net/base_entity_factory.dart';

import 'interest_chat_channel_entity.dart';

class ContactEntityFactory with BaseEntityFactory{
  static final ContactEntityFactory _singleton = ContactEntityFactory._internal();

  static ContactEntityFactory get instance => ContactEntityFactory();


  factory ContactEntityFactory() {
    return _singleton;
  }

  ContactEntityFactory._internal(){
    //做一些操作
  }

   T generateOBJ<T>(json) {
    if(json==null)return null;
    if (1 == 0) {
      return null;
    } else if (T.toString() == "String") {
      return json as T;
    }
    else if (T.toString() == "InterestChatChannelEntity") {
      return InterestChatChannelEntity.fromJson(json) as T;
    }

    else {
      return null;
    }
  }
}
